<template>
  <view class="header">
    <view class="main padding-x-20">
      <view class="top h-100 flex-between-start">
        <view class="left flex-start-center">
          <!-- <view class="top-click w-60 h-42 p-t-30 p-r-30">
            <image
              class="w-100p h-100p"
              src="/src/static/image/menu.png"
              mode="aspectFit"
            ></image>
          </view> -->
          <view class="logo w-130 h-40 p-l-6 p-t-28">
            <image
              class="w-100p h-100p"
              src="/src/static/image/logo.png"
              mode="aspectFit"
            ></image>
          </view>
        </view>
        <view class="right flex-start-center p-t-40 f-24 lh-40">
          <view class="phone w-24 h-24 m-r-16">
            <image
              class="w-100p h-100p"
              src="/src/static/image/phone.png"
              mode="aspectFit"
            ></image>
          </view>
          <view class="text"> 400-118-1098 </view>
        </view>
      </view>
      <view class="nav h-100 flex-between-center text-align-center f-24">
        <view class="nav-item w-120" @click="navigateTo('/pages/index/index')">
          首页
        </view>
        <view
          class="nav-item w-120"
          @click="navigateTo('/pages/course/course')"
        >
          课程
        </view>
        <view
          class="nav-item w-120"
          @click="navigateTo('/pages/teacher/teacher')"
        >
          名师
        </view>
        <!-- <view class="nav-item w-120"> 1+X课程 </view> -->
        <view
          class="nav-item w-120"
          @click="navigateTo('/pages/aboutTime/aboutTime')"
        >
          关于时光
        </view>
      </view>
    </view>
  </view>
</template>
<script setup lang="ts">
const navigateTo = (path: string) => {
  //获取当前路由
  const pages = getCurrentPages();
  const currentPage = pages[pages.length - 1];
  const route = currentPage.route;
  //判断是否是当前页面，如果是，则不跳转
  if ("/" + route === path) {
    return;
  }
  uni.navigateTo({
    url: path,
  });
};
</script>
<style lang="scss" scoped>
.header {
  background-color: #170d2e;
  .main {
    .top {
      .left {
      }
      .right {
        color: #d7bdab;
      }
    }
    .nav {
      color: #fffdf1;
      .nav-item {
      }
    }
  }
}
</style>
